package com.pwc.ackAdvance;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author fantuancyh
 * @data 2021/8/22
 */
@Component
@Slf4j
public class LogConsumer {
    private static final String WARNING_QUEUE_NAME = "warning.queue";

    @RabbitListener(queues =WARNING_QUEUE_NAME )
    public void consumeLogMessage(Message message){
        String s = new String(message.getBody());
        log.info("warn队列收到消息{}",s);
    }
}
